<?php
class ArticlesController extends AppController {
	var $uses = array('Article','Questioncatch');
	
	public function index() {
		$this->set('title_for_layout', 'Asking.vn - Blog chia sẻ kinh nghiệm');		
		$this->set('questioncatches',
				$this->Questioncatch->getCountQuestionsByFeatureCatchwords());
		$this->set('articles',$this->Article->getList());
		$this->set('features', $this->Article->getFeatures());
	}	
	
	public function view($id = null){
		$this->set('articles',$this->Article->getDetail($id));
		$this->set('questioncatches',$this->Questioncatch->getCountQuestionsByFeatureCatchwords());
		$this->set('features', $this->Article->getFeatures());
		$this->set('latests', $this->Article->getFeatures(5,'latest'));	
	}
	public function listType($type = null){
		$this->set('articles',$this->Article->getList($type));
		$this->set('questioncatches',$this->Questioncatch->getCountQuestionsByFeatureCatchwords());
		$this->set('features', $this->Article->getFeatures());
	}
}